package com.yuejian_06.yuejian_06.activity;

import android.net.Uri;
import android.os.Bundle;
import android.view.View;
import android.widget.ImageButton;
import android.widget.MediaController;
import android.widget.TextView;
import android.widget.VideoView;

import com.yuejian_06.yuejian_06.R;
import com.yuejian_06.yuejian_06.fragment.Constants;
import com.yuejian_06.yuejian_06.fragment.Constants_l;

public class CoachVideoActivity extends BaseActivity {
    TextView cv_name,cv_info,cv_good;
    VideoView cv_video;
    ImageButton cv_back;
    String id,name,goods,info,video;
    @Override
    void initViews() {
        setLayout(R.layout.activity_coach_video);
        cv_name = (TextView)findViewById(R.id.cv_name);
        cv_info = (TextView)findViewById(R.id.cv_info);
        cv_good = (TextView)findViewById(R.id.cv_good);
        cv_video =(VideoView)findViewById(R.id.cv_videoView);
        cv_back = (ImageButton)findViewById(R.id.cv_back);
        Bundle bundle = getIntent().getExtras();
        id = bundle.getString("cv_id");
        name=bundle.getString("cv_name");
        video=bundle.getString("cv_video");
        info=bundle.getString("cv_intro");
        goods=bundle.getString("cv_star");

        cv_name.setText(name);
        cv_info.setText(info);
        cv_good.setText(goods);

        String internetUrl = Constants.SSS+"yuejian/Public/coachVideo/"+video;
        if(true)
        {
            cv_video.setVideoURI(Uri.parse(internetUrl));
            MediaController controller =new MediaController(CoachVideoActivity.this);
            cv_video.setMediaController(controller);
            controller.setMediaPlayer(cv_video);

        }
        else
        {}

    }

    @Override
    void initEvents() {
        cv_back.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                finish();
            }
        });
    }

    @Override
    void initData() {

    }
}
